# Contributor: Brien Dieterle <briend@gmail.com>

_realname=colour
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python2-${_realname}" "${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
pkgver=0.3.11
pkgrel=1
pkgdesc="Python library for a multitude of colour science applications (mingw-w64)"
arch=('any')
license=('BSD-3-Clause')
url="https://pypi.python.org/pypi/colour-science"
depends=("${MINGW_PACKAGE_PREFIX}-python2-numpy"
         "${MINGW_PACKAGE_PREFIX}-python3-numpy"
         "${MINGW_PACKAGE_PREFIX}-python2-scipy"
         "${MINGW_PACKAGE_PREFIX}-python3-scipy"
         "${MINGW_PACKAGE_PREFIX}-python2-six"
         "${MINGW_PACKAGE_PREFIX}-python3-six")

makedepends=("${MINGW_PACKAGE_PREFIX}-python2-pip"
             "${MINGW_PACKAGE_PREFIX}-python3-pip")
options=('staticlibs')
source=("${_realname}-${pkgver}.tar.gz"::"https://github.com/colour-science/colour/archive/v${pkgver}.tar.gz")
sha256sums=('df048ca5097a44833039a0392b9f7af649a220204c2e8252fd8639dfce4add3e')

prepare() {
  cd ${srcdir}
  cp -r ${_realname}-${pkgver} python2-build
  cp -r ${_realname}-${pkgver} python3-build
}

package_python2-colour() {
  depends=("${MINGW_PACKAGE_PREFIX}-python2")

  cd "${srcdir}/python2-build"
  pip2 install .
  install -Dm644 COPYING "${pkgdir}${MINGW_PREFIX}/share/licenses/python2-${_realname}/COPYING"
}

package_python3-colour() {
  depends=("${MINGW_PACKAGE_PREFIX}-python3")

  cd "${srcdir}/python3-build"
  pip3 install .
  install -Dm644 COPYING "${pkgdir}${MINGW_PREFIX}/share/licenses/python3-${_realname}/COPYING"
}

package_mingw-w64-i686-python2-colour() {
  package_python2-colour
}

package_mingw-w64-i686-python3-colour() {
  package_python3-colour
}

package_mingw-w64-x86_64-python2-colour() {
  package_python2-colour
}

package_mingw-w64-x86_64-python3-colour() {
  package_python3-colour
}
